package com.crane.oss.app.service;

import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Component;

/**
 * @Author: zhenxing.pi
 * @Date: 2021/1/7 17:06
 */
@Component
@MessagingGateway(defaultRequestChannel = "mqttOutboundChannel")
public interface AppMqttApi {
    /**
     * app mqtt消息推送
     * @param data
     * @param topic
     */
    void sendToMqtt(String data, @Header(MqttHeaders.TOPIC) String topic);
}
